﻿Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data.SqlHelper

Public Class CualidadesUDM

    Public Function GenerarCualidades(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "CualidadesGenerar", New SqlParameter("@NomCua", Dat(0)), _
        New SqlParameter("@ObsCua", Dat(1)), New SqlParameter("@CodTDC", Dat(2)))
        Return DS
    End Function

    Public Function GenerarTDC(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "TiposDeCualidadesGenerar", New SqlParameter("@NomTDC", Dat(0)))
        Return DS
    End Function

    Public Function EliminarCualidades(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "CualidadesEliminar", New SqlParameter("@Cod", Dat(0)))
        Return DS
    End Function

    Public Function EliminarTDC(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "TiposDeCualidadesEliminar", New SqlParameter("@Cod", Dat(0)))
        Return DS
    End Function

    Public Function EliminarUDM(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "UnidadDeMedidaEliminar", New SqlParameter("@Cod", Dat(0)))
        Return DS
    End Function

    Public Function ObtenerCualidades(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "CualidadesObtener", New SqlParameter("@NomCua", Dat(0)), _
          New SqlParameter("@Est", Dat(1)), New SqlParameter("@CodTDCOI", Dat(2)), _
          New SqlParameter("@NomCla", Dat(3)), New SqlParameter("@Tip", Dat(4)))
        Return DS
    End Function

    Public Function ObtenerTDC(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "TiposDeCualidadesObtener", New SqlParameter("@NomTDC", Dat(0)), _
        New SqlParameter("@Est", Dat(1)), New SqlParameter("@Tip", Dat(2)))
        Return DS
    End Function

    Public Function GenerarUnidadesDeMedida(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "UnidadesDeMedidaGenerar", New SqlParameter("@Tip", Dat(0)))
        Return DS
    End Function

    Public Function EliminarUnidadesDeMedida(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "UnidadesDeMedidaEliminar", New SqlParameter("@Tip", Dat(0)))
        Return DS
    End Function

    Public Function ObtenerUnidadesDeMedida(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "UnidadesDeMedidaObtener", New SqlParameter("@Nom", Dat(0)), _
        New SqlParameter("@Tip", Dat(1)))
        Return DS
    End Function

End Class
